﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MathNet.Numerics.LinearAlgebra.Single;

namespace cudaMatrix
{
    public enum ComputationHost {CPU, CUDA}

    public class MatrixFactory
    {
        private static ComputationHost computationHost = ComputationHost.CUDA;


        //ustawia srodowisko obliczen
        public static ComputationHost COMPUTER
        {
            get
            {
                return computationHost;
            }
            set
            {
                computationHost = value;
            }
        }

        //tworzy nowa macierz
        public static DenseMatrix createMatrix(int rows, int columns, float[] values)
        {
            switch (computationHost)
            {
                case ComputationHost.CPU:
                    return new DenseMatrix(rows, columns, values);
                case ComputationHost.CUDA:
                    return new CudaMatrix(rows, columns, values);
            }
            return new DenseMatrix(rows, columns, values);
        }

    }
}
